package com.jd.finance.core.controller;


import com.jd.finance.core.service.ProductService;
import com.jd.finance.result.BaseResult;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

/**
 * <p>
 * 贷款产品表 前端控制器
 * </p>
 *
 * @author LiQingBo
 * @since 2022-05-17
 */
@Slf4j
@RestController
@RequestMapping("/api/core/productCenter")
public class ProductController {

    @Resource
    private ProductService productService;

    @ApiOperation("根据产品id，查询其相关信息")
    @GetMapping("/getProductInfo")
    public BaseResult getProductInfo(Integer pid) {
        if (pid==null) {
            log.error("pid为空!");
            return BaseResult.error().message("pid为空!");
        }

        return productService.getProductInfo(pid);
    }



}

